package com.hsylient.javase.chapter11.practice;

import lombok.SneakyThrows;

import java.text.SimpleDateFormat;
import java.util.Date;

public class CurrentTime {

    @SneakyThrows
    public static void main(String[] args) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        while (true) {
            System.out.println(simpleDateFormat.format(new Date()));
            Thread.sleep(1000);

        }
    }
}
